<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>

<body>
    <script>
    var Panda={};
    Panda.name="托比";
    Panda.age="250"
    Panda.sayHello=function(){
        console.log("大家吼"+Panda.name+",今年"+Panda["age"]+"岁了");
    }
    Panda.sayHello();
    </script>
    <script>
function Person(){}
var personOne=new Person();
personOne.name="kenan";
personOne.hobby="coding";
personOne.work=function(){
    alert(personOne.name+" 我喜欢探案");
}
personOne.work();
</script>    
    <script>
        function Person(name, age, hobby) {
            this.name = name;
            this.hobby = hobby;
            this.eat = function () {
                console.log('我叫' + this.name + '，我喜欢' + this.hobby + ',也是个吃货')
            }
        }
        var a1 = new Person('柯南', 1, '侦探');

        var a2 = new Person('麦兜', 2, '吃');
        var a3 = new Person('喜洋洋', 3, '玩');
        a1.eat();
        a2.eat();
        a3.eat();
    </script>
</body>

</html>